﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="JT_SateAdd.aspx.cs" Inherits="JTicket.UI.JT_SateAdd" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        //页面初始下载
        $(document).ready(function () {
            if (Flag == "Edite") {
                $("#BtnAdd").hide();

                JTicket.UI.Service.JT_StatSvc.GetModel(ID,
            function Success(Reuslt) {
                if (Reuslt != null) {
                    //*****绑定下拉框

                    $("#txtStatCode").val(Reuslt.StatCode);
                    $("#txtStatName").val(Reuslt.StatName);
                    $("#txtNote").val(Reuslt.Note);
                } else { window.location.href = "JT_StateManager.aspx"; }
            },
            function Fail(Reuslt) { isAlertError(); });

            } else { $("#BtnEdite").hide(); }
        });
        //添加
        function Add() {
            var model = new JTicket.Model.C_StatInfo();
            model.ThCode = "1";
            model.StatCode = $("#txtStatCode").attr("value");
            model.StatName = $("#txtStatName").attr("value");
            model.Note = $("#txtNote").attr("value");
            JTicket.UI.Service.JT_StatSvc.Add(model,
    function Success(Result)
    { alert(Result); },
    function fail(Result) {
        isAlertError();
    });
        }
        //修改
        function Update() {

            var model = new JTicket.Model.C_StatInfo();
            model.ThCode = "1";
            model.StatCode = $("#txtStatCode").attr("value");
            model.StatName = $("#txtStatName").attr("value");
            model.Note = $("#txtNote").attr("value");
            JTicket.UI.Service.JT_StatSvc.Update(model,
            function Success(Result){ alert("修改成功！");},
            function fail(Result) { isAlertError(); });

        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="sm" runat="server">
        <Services>
            <asp:ServiceReference InlineScript="true" Path="~/Service/JT_StatSvc.asmx" />
        </Services>
    </asp:ScriptManager>
    <table align="center" border="0" cellpadding="4" cellspacing="1" class="toptable grid"
        width="100%">
        <tr>
            <td class="category t2" height="25" width="100">
                售票站点添加
            </td>
            <td class="category" height="25">
            </td>
        </tr>
    </table>
    <table cellpadding="1" cellspacing="1" id="TbInfo" class="TbInfo">
        <tr>
            <td align="right" bgcolor="#3890B5" class="B" style="width: 130px">
                名称
            </td>
            <td height="25" align="right" bgcolor="#3890B5" class="B">
                操作
            </td>
            <td align="right" bgcolor="#3890B5" class="B" style="width: 50px">
                说明
            </td>
        </tr>
        <tr>
            <td align="center" bgcolor="#F6F6F6" style="width: 130px; height: 25px;">
                所属剧院：
            </td>
            <td align="left" bgcolor="#F6F6F6" style="height: 25px">
                <select id="seTheater" name="S3">
                    <option></option>
                </select>
            </td>
            <td bgcolor="#F6F6F6" style="height: 25px; width: 171px;">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td align="center" bgcolor="#F6F6F6" style="width: 130px; height: 25px;">
                售票站点编号：
            </td>
            <td align="left" bgcolor="#F6F6F6" style="height: 25px">
                <input id="txtStatCode" type="text" />
            </td>
            <td bgcolor="#F6F6F6" style="height: 25px; width: 171px;">
                必填
            </td>
        </tr>
        <tr>
            <td align="center" bgcolor="#F6F6F6" style="width: 130px; height: 25px;">
                售票站点名称：
            </td>
            <td align="left" bgcolor="#F6F6F6" style="height: 25px">
                <input id="txtStatName" type="text" style="width: 300px;" />
            </td>
            <td bgcolor="#F6F6F6" style="height: 25px; width: 171px;">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td align="center" bgcolor="#F6F6F6" style="width: 130px;">
                备注：
            </td>
            <td bgcolor="#F6F6F6" style="width: 130px;">
                <textarea id="txtNote" class="textarea" cols="20" name="S1" rows="20"></textarea>
            </td>
            <td bgcolor="#F6F6F6" style="width: 171px;">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td align="center" bgcolor="#F6F6F6" style="width: 130px">
            </td>
            <td height="25" bgcolor="#F6F6F6" align="center">
                <input type="button" id="BtnAdd" value="添  加" onclick="Add();" onmousemove="showBtnOver(this)"
                    onmouseout="showBtnOut(this)" class="submitMiniGreen" />
                <input type="button" id="BtnEdite" value="修  改" onclick="Update();" onmousemove="showBtnOver(this)"
                    onmouseout="showBtnOut(this)" class="submitMiniGreen" />
                <input type="button" id="BtnBack" value="返  回" onclick="javascript:window.location.href ='JT_StatManage.aspx'"
                    onmousemove="showBtnOver(this)" onmouseout="showBtnOut(this)" class="submitMiniGreen" />
            </td>
            <td bgcolor="#F6F6F6" style="width: 171px">
                &nbsp;
            </td>
        </tr>
    </table>
</asp:Content>
